package io.renren.modules.article.openfeign;


import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.article.entity.ArticleEntity;
import io.renren.modules.article.entity.LabelEntity;

import io.renren.modules.article.entity.ModuleEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Arrays;
import java.util.Map;

/**
 * @author 李涛
 * @date 2020-08-18 14:49
 */
@FeignClient("hunzi-article")
public interface ArticleOpenFeignService {
    /*
        标签服务
     */

    @RequestMapping("/article/label/list")
     R listLable(@RequestParam Map<String, Object> params);

    @RequestMapping("/article/label/save")
    R saveLabel(@RequestBody LabelEntity label);

    @RequestMapping("/article/label/delete")
    R deleteLabel(@RequestBody Long[] ids);


    @RequestMapping("/article/label/update")
    R updateLabel(@RequestBody LabelEntity label);

    @RequestMapping("/article/label/info/{id}")
    R infoLabel(@PathVariable("id") Long id);

    /*
        板块服务
     */
    @RequestMapping("/article/module/save")
    R saveModule(@RequestBody ModuleEntity module);

    @RequestMapping("/article/module/list")
    R listModlue(@RequestParam Map<String, Object> params);

    @RequestMapping("/article/module/info/{id}")
    R infoModule(@PathVariable("id") Long id);

    @RequestMapping("/article/module/update")
    R updateModule(@RequestBody ModuleEntity module);

    @RequestMapping("/article/module/delete")
    R deleteModule(@RequestBody Long[] ids);
    /*
      文章/帖子服务
     */
    @RequestMapping("/article/article/list")
    R listArticle(@RequestParam Map<String, Object> params);

    @RequestMapping("/article/article/save")
    R saveArticle(@RequestBody ArticleEntity article);
}
